import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes = [
  {
    path: '/',
    name:'home',
    component: HomeView,
    redirect:'/index',
    children:[
        {
      path: '/parcel',
      component: () => import( '../views/home/ParcelView.vue'),
          redirect:'/ownerparcel',
      children:[
          {
        path: '/ownerparcel',
        component: () => import( '../views/home/parcel/OwnerParcel.vue')
      } ,{
          path: '/shipmentman',
          component: () => import( '../views/home/parcel/ShipmentMan.vue')
        }
      ]
    }
    ]
  },
  {
    path: '/column',
    component: () => import('../views/ColumnView.vue'),
  },
  {
    path: '/role',
    component: () => import('../views/RoleView.vue'),
  },

  {
    path: '/subaccount',
    component: () => import('../views/SubAccountView.vue'),
  },
  {
    path: '/allocate',
    component: () => import('../views/AllocateView.vue'),
  },
  {
    path: '/index',
    component: () => import( '../views/IndexView.vue')

  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
